#include <iom2560v.h>
#include <macros.h>
#include "board.h"
#ifndef __OLEDWork_H
#define __OLEDWork_H			  	 


#define	u8 unsigned char
#define	u16 unsigned int
#define	u32 unsigned long

#define OLED_CMD  0	//D��?����?
#define OLED_DATA 1	//D�䨺y?Y
#define OLED_MODE 0

#define OLED_CS (1<<3)  //????
#define OLED_RST (1<<6)
#define OLED_DC  (1<<2) 
#define OLED_SCL (1<<1) 
#define OLED_SDIN (1<<2) 


#define OLED_CS_Clr()  PORTL&=~OLED_CS
#define OLED_CS_Set()  PORTL|=OLED_CS

#define OLED_RST_Clr() PORTL&=~OLED_RST
#define OLED_RST_Set() PORTL|=OLED_RST

#define OLED_DC_Clr() PORTG&=~OLED_DC
#define OLED_DC_Set() PORTG|=OLED_DC

#define OLED_SCLK_Clr() PORTB&=~OLED_SCL
#define OLED_SCLK_Set() PORTB|=OLED_SCL

#define OLED_SDIN_Clr() PORTB&=~OLED_SDIN
#define OLED_SDIN_Set() PORTB|=OLED_SDIN





//OLED?�꨺?����??
//0:4??��?DD?�꨺?
//1:2��DD8080?�꨺?

#define SIZE 16
#define XLevelL		0x02
#define XLevelH		0x10
#define Max_Column	128
#define Max_Row		64
#define	Brightness	0xFF 
#define X_WIDTH 	128
#define Y_WIDTH 	64	    						  
//-----------------OLED???��?����?----------------  					   

//void delay_ms(unsigned int ms);


 		     

//OLED????��?o����y
void OLED_WR_Byte(u8 dat,u8 cmd);	    
void OLED_Display_On(void);
void OLED_Display_Off(void);	   							   		    
void OLED_Init(void);
void OLED_Clear(void);
void OLED_DrawPoint(u8 x,u8 y,u8 t);
void OLED_Fill(u8 x1,u8 y1,u8 x2,u8 y2,u8 dot);
void OLED_ShowChar(u8 x,u8 y,u8 chr);

void OLED_ShowNum(u8 x, u8 y, u32 num, u8 len, u8 size2);

void OLED_ShowString(u8 x,u8 y, u8 *p);	 
void OLED_Set_Pos(unsigned char x, unsigned char y);
void OLED_ShowCHinese(u8 x,u8 y,u8 no);
void OLED_DrawBMP(unsigned char x0, unsigned char y0,unsigned char x1, unsigned char y1,unsigned char BMP[]);
#endif  
	 



